/**
 * 自定义指令
 * Copyright (c) 2023 dfec
 */
import hasRole from './permission/hasRole'
import hasPermi from './permission/hasPermi'
import dialogDrag from './dialog/drag'
import dialogDragWidth from './dialog/dragWidth'
import dialogDragHeight from './dialog/dragHeight'
import clipboard from './module/clipboard'

const install = function(Vue) {
    // 判断是否拥有角色
    Vue.directive('hasRole', hasRole)
    // 判断是否拥有角色
    Vue.directive('hasPermi', hasPermi)
    // 文字粘贴复制
    Vue.directive('clipboard', clipboard)
    // 弹框拖拽
    Vue.directive('dialogDrag', dialogDrag)
    // 弹框宽度
    Vue.directive('dialogDragWidth', dialogDragWidth)
    // 弹框高度
    Vue.directive('dialogDragHeight', dialogDragHeight)
}

if (window.Vue) {
    window['hasRole'] = hasRole
    window['hasPermi'] = hasPermi
    // eslint-disable-next-line no-undef
    Vue.use(install)
}

export default install
